package com.csu.letaobackend.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.csu.letaobackend.bean.Item;
import com.csu.letaobackend.bean.Specialoffer;
import com.csu.letaobackend.bean.Swiperitem;
import com.csu.letaobackend.commom.CommonResponse;
import com.csu.letaobackend.dto.ItemVO2;
import com.csu.letaobackend.vo.*;

import java.util.List;

public interface CatalogService {

      CommonResponse<List<SwiperitemVO>> getSwiperitems();

      CommonResponse<List<CategoryVO>> getCategories();

      CommonResponse<List<ProductVO>> getProductsByCategoryId(int categoryId);

      CommonResponse<List<ItemVO>> getItemsByProductId(int productId, String username);

      CommonResponse<List<ItemVO>> getItemsByProductId(int productId, int sortby, String username);

      CommonResponse<IPage<ItemVO>> getItemsPages(int productId, int sortby, int currentPage, int pageSize, String username);

      CommonResponse<ItemVO> getItem(int itemId, String username);

      CommonResponse<List<ItemAttrVO>> getAttrByItemId(int itemId);

      CommonResponse<List<ItemVO>> getItemsByShopId(int shopId, int sortby, String username);

      CommonResponse<IPage<ItemVO>> getItemsPagesByShopId(int shopId, int sortby, int currentPage, int pageSize, String username);

      CommonResponse<IPage<ItemVO>> searchItemsPages(String keyword, int categoryId, int sortby, int currentPage, int pageSize, String username);

      CommonResponse<List<ItemVO>> getPopularItems(int num);

      /**
       * 卖家
       */
      CommonResponse<ItemVO> updateStockByItemId(int itemId, int stock);

      CommonResponse<ItemVO> updatePriceByItemId(int itemId, double price);

      CommonResponse<ItemVO> updateByItemId(int itemId, int stock, double price, String description);

      CommonResponse<ItemVO> updateAvailableByItemId(int itemId,int available);

      CommonResponse<Specialoffer> updateSpecialRateByItemId(int itemId, double specialRate);

      CommonResponse additem(ItemVO2 itemVO2);

      CommonResponse updateitem(int itemid, int stock,int price,String description);

      CommonResponse<List<BrowsingrecordVO>> getRecords(String username);

      CommonResponse<BrowsingrecordVO> insertRecord(int itemid, String username);


}
